package eight.test_8_5;

public class Solution {
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     *
     * @param schedule int整型二维数组
     * @return bool布尔型
     */
    public boolean hostschedule (int[][] schedule) {
        int[] arr = new int[1000000001];
        // write code here
        int start = 0;
        int end = 0;
        for (int i = 0; i < schedule.length; i++) {
            int left = Math.min(schedule[i][0],schedule[i][1]);
            int right = Math.max(schedule[i][0],schedule[i][1]);
            for (int j = left; j <= right; j++) {
                if(arr[j] == - 1) {
                    return false;
                }
                arr[j] = -1;
            }
        }
        return true;
    }
}
